setTimeout(function () {
  console.log("1");
});

new Promise(function (resolve) {
  console.log("2");

  for (var i = 0; i < 1000; i++) {
    i == 99 && resolve();
  }

  console.log("3");
}).then(function () {
  console.log("4");
});

console.log("5");
